<%= error_messages_for :user %>
<% form_for :user, :url => users_path do |f| -%>
<p><label for="login">Login:</label><br />
<%= f.text_field :login %></p>

<p><label for="name">Name: </label><br />
<%= f.text_field :name %></p>

<p><label for="password">Password: </label><br />
<%= f.password_field :password %></p>

<p><label for="password_confirmation">Confirm Password: </label><br />
<%= f.password_field :password_confirmation %></p>

<p><label for="admin"></label>
<%= f.check_box :admin %> Admin</p>

<p><label for="groups"></label>
<p> Groups: <br />
  <% for group in @groups%>
    <input type="checkbox"
        id="<%= group.id%>"
	name="groups[]"
	value="<%= group.id%>"
	<%if @user.groups and (@user.groups.include? group)%> checked="checked"<%end%>
    > 
    <%= group.name %>
  <% end if @groups%>
</p>

<p><%= submit_tag 'Sign up' %></p>
<% end -%>
